{
  'targets': [
    {
      'target_name': 'protoserv-java-descriptor-sources',
      'type': 'none',
      'dependencies': [
        '<(DEPTH)/<(THIRD_PARTY)/protobuf/build.gyp:protoc',
      ],
      'actions': [
        {
          'action_name': 'compile_descriptors',
          'inputs': [
            '<(DEPTH)/proto/protoserv/protocol.proto',
            '<(DEPTH)/proto/protoserv/transport.proto',
          ],
          'outputs': [
            'gen/com/googlecode/protoserv/Protocol.java',
            'gen/com/googlecode/protoserv/Transport.java',
          ],
          'action': [
            '<(DEPTH)/out/Default/protoc',
            '--proto_path=<(DEPTH)/<(THIRD_PARTY)/protobuf/trunk/src',
            '--proto_path=<(DEPTH)/proto',
            '<(DEPTH)/proto/protoserv/protocol.proto',
            '<(DEPTH)/proto/protoserv/transport.proto',
            '--java_out=gen',
          ],
        },
        {
          'action_name': 'patch_request',
          'inputs': [
            'gen/com/googlecode/protoserv/Protocol.java',
          ],
          'outputs': [
            'gen/com/googlecode/protoserv/Protocol.java.bkp',
          ],
          'action': [
            'python', 'patch.py',
            'gen/com/googlecode/protoserv/Protocol.java',
          ],
        },
      ],
    },
    {
      'target_name': 'protoserv-java',
      'type': 'none',
      'dependencies': [
        '<(DEPTH)/<(THIRD_PARTY)/protobuf/build.gyp:protobuf-java',
        'protoserv-java-descriptor-sources',
      ],
      'actions': [
        {
          'action_name': 'ant',
          'inputs': [
            'build.xml',
            'client/com/googlecode/protoserv/ByteStream.java',
            'client/com/googlecode/protoserv/GenericStub.java',
            'client/com/googlecode/protoserv/HttpConstants.java',
            'client/com/googlecode/protoserv/HttpTransport.java',
            'client/com/googlecode/protoserv/Rpc.java',
            'client/com/googlecode/protoserv/RpcCallback.java',
            'client/com/googlecode/protoserv/RpcChannel.java',
            'client/com/googlecode/protoserv/RpcTransport.java',
            'client/com/googlecode/protoserv/TcpTransport.java',
            'gen/com/googlecode/protoserv/Protocol.java',
            'gen/com/googlecode/protoserv/Transport.java',
            'jetty/com/googlecode/protoserv/JettyRpcServer.java',
            'lib/google-gson-stream-2.0.jar',
            'lib/jetty-6.1.22.jar',
            'lib/jetty-util-6.1.22.jar',
            'lib/protobuf-java.jar',
            'lib/servlet-api-2.5.jar',
            'server/com/googlecode/protoserv/Base64.java',
            'server/com/googlecode/protoserv/JsonFormat.java',
            'server/com/googlecode/protoserv/RpcHandler.java',
            'server/com/googlecode/protoserv/RpcManager.java',
            'server/com/googlecode/protoserv/RpcServlet.java',
            'server/com/googlecode/protoserv/ServiceSkel.java',
          ],
          'outputs': [
            '<(PRODUCT_DIR)/protoserv-client.jar',
            '<(PRODUCT_DIR)/protoserv-server.jar',
            '<(PRODUCT_DIR)/protoserv-server+jetty.jar',
          ],
          'action': [
            'ant', #'-q',
            '-Dbuild_dir=<(INTERMEDIATE_DIR)/java/server',
            '-Ddeploy_dir=<(PRODUCT_DIR)',
          ],
        },
      ],
    },
  ],
}
